package lohr.lang.dom;

import java.util.Collections;
import java.util.List;

/**
 * A list of type parameters.
 * 
 * Example:  <Integer, Map>
 * 
 * @author ted stockwell
 */
public class TypeParameterDeclaration extends LohrElement {
	private List<TypeReference> _names;
	
	public TypeParameterDeclaration(List<TypeReference> names) {
		addChildren(_names= Collections.unmodifiableList(names));
	}
	
	public List<TypeReference> getTypes() {
		return _names;
	}
	
	@Override
	public String toString() {
		String s= "<";
		boolean first= true;
		for (TypeReference reference : _names) {
			if (!first)
				s+= ", ";
			s+= reference.toString();
			first= false;
		}
		s+= ">";
		return s;
	}

}
